#!/bin/env python

import time

import cv2
import numpy as np
import gzip

import digits_ann as ANN

start_time = time.time()
# 创建一个人工神经网络，设置隐藏层节点数，设置样本数量
ann, test_data = ANN.train(ANN.create_ANN(58), 50000)
end_time = time.time()
elapsed_time = end_time - start_time  # 计算经过的时间
print("训练耗时：", elapsed_time, "秒")

filename = 'digital_recognition_model.xml'
print("模型导出到：", filename)
# 保存模型
ann.save(filename)

